#!/bin/sh

# $Id: rc 221 2007-11-11 17:17:06Z mwiget $
# part of m0n0wall (http://m0n0.ch/wall)
#
# Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
# All rights reserved.

stty status '^T'

trap : 2
trap : 3

HOME=/
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
export HOME PATH

set -T
trap "echo 'Reboot interrupted'; exit 1" 3


# generate circular logfiles
#clog -i -s 262144 /var/log/system.log
#clog -i -s 262144 /var/log/filter.log
#clog -i -s 65536 /var/log/vpn.log
#clog -i -s 32768 /var/log/dhcpd.log
#clog -i -s 32768 /var/log/portalauth.log
#clog -i -s 65536 /var/log/siproxd.log
#chmod 0600 /var/log/*.log

# make some directories in /var
mdmfs -S -s 32M -o async md /var
mkdir -p /var/run /var/log /var/etc /var/db /var/empty /var/wWebmin /var/at/jobs
mount -t nfs -o tcp master-wbsd:/usr/jail/root/wWebmin /var/wWebmin

mkdir -p /var/log/nanoweb
touch /var/log/wwebmin.log
chown www:www /var/log/wwebmin.log

mdmfs -S -s 32M -o async md /tmp
chmod 0777 /tmp

#adjkerntz -i

# Create an initial utmp file
cd /var/run && cp /dev/null utmp && chmod 644 utmp

# Run ldconfig
/sbin/ldconfig -elf /usr/lib

# disable core dumping (to avoid running out of MFS space)
/sbin/sysctl kern.coredump=0

# let the PHP-based configuration subsystem set up the system now
#/etc/rc.bootup

#/etc/rc.banner

inetd
# web service
exit 0
